<html>
  <head>
    <title>pg_tileserv</title>
    <!-- <link rel="stylesheet" type="text/css" href="pg_tileserv.css" /> -->
  </head>
  <style type="text/css">
    body {margin:0;padding:0;font-family:sans-serif;}
    h1 {padding:1em;margin:0;width:auto;background:#0167B4;color:white;}
    #content {padding:1em 2em;line-height:1.3em;}
    h2 {font-size:120%;}
  </style>
<body>
  <h1>pg_tileserv</h1>
<div id="content">

  <h2>Service Metadata</h2>
  <ul>
    <li><strong><a href='index.json'>index.json</a></strong> for layer list</li>
  </ul>

  <h2>Table Layers</h2>
  <ul>
  {{ range $key, $value := . }}
  {{ if eq $value.Type "table" }}
  <li>
    <strong class="layer-name">{{ $value.ID }}</strong> (<a href='{{ $value.DetailURL | replace ".json" ".html"}}'>preview</a> | <a href="{{ $value.DetailURL }}">json</a>)
    {{ if $value.Description }}<br/><span class="layer-description">{{ $value.Description }}</span> {{ end }}
  </li>
  {{ end }}
  {{ end }}
  </ul>

  <h2>Function Layers</h2>
  <ul>
  {{ range $key, $value := . }}
  {{ if eq $value.Type "function" }}
  <li>
    <strong class="layer-name">{{ $value.ID }}</strong> (<a href='{{$value.DetailURL | replace ".json" ".html"}}'>preview</a> | <a href="{{ $value.DetailURL }}">json</a>)
    {{ if $value.Description }}<br/><span class="layer-description">{{ $value.Description }}</span> {{ end }}
  </li>
  {{ end }}
  {{ end }}
  </ul>
</div>
</body>
</html>
